﻿#ifndef CONTROLWIDGET_H
#define CONTROLWIDGET_H

#include <QWidget>
#include<QPainter>
#include<QImage>
#include"qslabel.h"

//绘画功能选择控件

#define CONTROL_WIDTH 540
#define CONTROL_HEIGHT 38
#define CONTROL_HEIGHTMARGIN 5

namespace Ui {
    class ControlWidget;
}

class Screen;

//仿照QQ截图的控制面板
class ControlWidget : public QWidget
{
    Q_OBJECT

public:
    explicit ControlWidget(QWidget *parent = 0);

    void connectSignalAndSlot();

    ~ControlWidget();

    void setDpi(int dp);

    void setCanClip(bool clip);

public slots:
    void on_cancelBtn_clicked();

    void on_saveBtn_clicked();

    void on_finishBtn_clicked();

    void on_textEditBtn_clicked();

    void on_rectangleBtn_clicked();

    void on_drawRoundBtn_clicked();

    void on_arrowBtn_clicked();

    void on_mosaicBtn_clicked();

    void on_returneditBtn_clicked();

    void on_drawLineBtn_clicked();

    void on_faceBtn_clicked();

    void on_clipBtn_clicked();

    void on_forwardBtn_clicked();

    void setReturnEnabled(bool isEnabled);

signals:
    void drawRect();
    void drawRound();
    void drawLine();
    void drawArrow();
    void drawFace();
    void drawText();
    void drawMosaic();
    void save();
    void clip();
    void forward();
    void undo();
    void cancel();
    void finish();
    void drawArrow2();

private slots:
    void on_arrow2Btn_clicked();

private:
    Ui::ControlWidget *ui;
    QPainter pt;
    QImage bg_gray;

};

#endif // CONTROLWIDGET_H
